Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle case numbers without number and year #1420

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Conversation

nickmwangemi
Copy link
Contributor

@nickmwangemi nickmwangemi commented Aug 1, 2023

Appeal 5 of 2018

image

Appeal of 2018

image

Appeal 5

image

5 of 2018

image

2018

image

5

image

parts = []

# Appeal 5 of 2018 (matter_type number year)
if self.matter_type and self.number and self.year:
Copy link
Contributor

@longhotsummer longhotsummer Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're adding partially built components, and having to handle all the permutations. I suggest simply adding them one-by-one, which will handle things better:

if self.matter_type:
  parts.append(self.matter_type)

if self.number:
  parts.append(self.number)

if self.year:
  parts.append(f'of {self.year}' if parts else self.year)

return ' '.join(parts)

@nickmwangemi nickmwangemi merged commit b74045d into main Aug 3, 2023
9 checks passed
@nickmwangemi nickmwangemi deleted the judgment-titles branch August 3, 2023 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated judgment titles must be sensitive of missing case details like numbers
2 participants